bitkeeper revision 1.1159.8.1 (41176a4bLElcLg3fxcgHsObA3Tdk8w)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 9 Aug 2004 12:12:59 +0000 (12:12 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 9 Aug 2004 12:12:59 +0000 (12:12 +0000)
Clean up synchronous 'event-channel callbacks' so that do_IRQ() is
always called with a valid pt_regs pointer.

.rootkeys
linux-2.4.26-xen-sparse/include/asm-xen/processor.h
linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h [deleted file]
linux-2.4.26-xen-sparse/include/asm-xen/system.h
linux-2.4.26-xen-sparse/mkbuildtree
linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h [deleted file]
linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h
linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h

index 8cdac7d9abbb3480d5155a107adb1384c564eaf5..bdeeb555d1e25bc5fc5d0ee2dfa679ec70fba848 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 3e5a4e67X7JyupgdYkgDX19Huj2sAw linux-2.4.26-xen-sparse/include/asm-xen/pgtable-2level.h
 3e5a4e67gr4NLGtQ5CvSLimMYZlkOA linux-2.4.26-xen-sparse/include/asm-xen/pgtable.h
 3e5a4e676uK4xErTBDH6XJREn9LSyg linux-2.4.26-xen-sparse/include/asm-xen/processor.h
-3e5a4e67AJPjW-zL7p-xWuA6IVeH1g linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h
 3e5a4e68uJz-xI0IBVMD7xRLQKJDFg linux-2.4.26-xen-sparse/include/asm-xen/segment.h
 3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA linux-2.4.26-xen-sparse/include/asm-xen/smp.h
 4062f7e2PzFOUGT0PaE7A0VprTU3JQ linux-2.4.26-xen-sparse/include/asm-xen/synch_bitops.h
 40f5623aEToIXouJgO-ao5d5pcEt1w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
 40f5623aCCXRPlGpNthVXstGz9ZV3A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable.h
 40f5623aPCkQQfPtJSooGdhcatrvnQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h
-40f5623bvhcUmESJrtcII6Bmd61b3w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h
 40f5623bzLvxr7WoJIxVf2OH4rCBJg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/segment.h
 40f5623bG_LzgG6-qwk292nTc5Wabw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h
 40f5623bgzm_9vwxpzJswlAxg298Gg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/synch_bitops.h
index 2b290252be18c673dffc4c404929323d0fb6e7af..9036704e230970cde9c7d27b5f6d99ff0a025c43 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef __ASM_I386_PROCESSOR_H
 #define __ASM_I386_PROCESSOR_H
 
+#include <asm/vm86.h>
 #include <asm/math_emu.h>
 #include <asm/segment.h>
 #include <asm/page.h>
@@ -479,6 +480,4 @@ extern inline void prefetchw(const void *x)
 
 #endif
 
-#define TF_MASK 0x100
-
 #endif /* __ASM_I386_PROCESSOR_H */
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h b/linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h
deleted file mode 100644 (file)
index 4457ac0..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef _I386_PTRACE_H
-#define _I386_PTRACE_H
-
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS  13
-#define EFL 14
-#define UESP 15
-#define SS   16
-#define FRAME_SIZE 17
-
-/* this struct defines the way the registers are stored on the 
-   stack during a system call. */
-
-struct pt_regs {
-       long ebx;
-       long ecx;
-       long edx;
-       long esi;
-       long edi;
-       long ebp;
-       long eax;
-       int  xds;
-       int  xes;
-       long orig_eax;
-       long eip;
-       int  xcs;
-       long eflags;
-       long esp;
-       int  xss;
-};
-
-/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-#define PTRACE_GETREGS            12
-#define PTRACE_SETREGS            13
-#define PTRACE_GETFPREGS          14
-#define PTRACE_SETFPREGS          15
-#define PTRACE_GETFPXREGS         18
-#define PTRACE_SETFPXREGS         19
-
-#define PTRACE_SETOPTIONS         21
-
-/* options set using PTRACE_SETOPTIONS */
-#define PTRACE_O_TRACESYSGOOD     0x00000001
-
-#ifdef __KERNEL__
-#define user_mode(regs) ((regs) && (2 & (regs)->xcs))
-#define instruction_pointer(regs) ((regs) ? (regs)->eip : NULL)
-extern void show_regs(struct pt_regs *);
-#endif
-
-#endif
index 6a8e352ac55f3bfd965a7217abf1069bcfefe32e..9be6e291feb9677922d529417880ba9b2bf4cffb 100644 (file)
@@ -323,7 +323,7 @@ do {                                                                          \
     _shared->vcpu_data[0].evtchn_upcall_mask = 0;                             \
     barrier(); /* unmask then check (avoid races) */                          \
     if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )              \
-        evtchn_do_upcall(NULL);                                               \
+        force_evtchn_callback();                                              \
 } while (0)
 
 #define __save_flags(x)                                                       \
@@ -338,7 +338,7 @@ do {                                                                          \
     if ( (_shared->vcpu_data[0].evtchn_upcall_mask = x) == 0 ) {              \
         barrier(); /* unmask then check (avoid races) */                      \
         if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )          \
-            evtchn_do_upcall(NULL);                                           \
+            force_evtchn_callback();                                          \
     }                                                                         \
 } while (0)
 
@@ -357,7 +357,7 @@ do {                                                                          \
     _shared->vcpu_data[0].evtchn_upcall_mask = 0;                             \
     barrier(); /* unmask then check (avoid races) */                          \
     if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )              \
-        evtchn_do_upcall(NULL);                                               \
+        force_evtchn_callback();                                              \
 } while (0)
 
 #define local_irq_save(x)       __save_and_cli(x)
index 2e8e20e6a9e51a7f27d3cc903381b0f5ecaaaaa5..8396693b74d5c051d1d9dd2a67b78c2c67ad7c6d 100755 (executable)
@@ -170,6 +170,7 @@ ln -sf ../asm-i386/parport.h
 ln -sf ../asm-i386/pgtable-3level.h 
 ln -sf ../asm-i386/poll.h 
 ln -sf ../asm-i386/posix_types.h 
+ln -sf ../asm-i386/ptrace.h 
 ln -sf ../asm-i386/resource.h 
 ln -sf ../asm-i386/rwlock.h 
 ln -sf ../asm-i386/rwsem.h 
@@ -202,6 +203,7 @@ ln -sf ../asm-i386/ucontext.h
 ln -sf ../asm-i386/unaligned.h
 ln -sf ../asm-i386/unistd.h 
 ln -sf ../asm-i386/user.h 
+ln -sf ../asm-i386/vm86.h 
 ln -sf ../../${LINUX_26}/include/asm-xen/ctrl_if.h
 ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h
 ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h
index 057bd8ab48a345a5c0630ca83eec3804523f4bfb..06d6ae948e38432cb7e50bafbe69fd953959473b 100644 (file)
@@ -46,6 +46,16 @@ extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
 
 #define VALID_EVTCHN(_chn) ((_chn) != -1)
 
+/*
+ * Force a proper event-channel callback from Xen after clearing the
+ * callback mask. We do this in a very simple manner, by making a call
+ * down into Xen. The pending flag will be checked by Xen on return.
+ */
+void force_evtchn_callback(void)
+{
+    (void)HYPERVISOR_xen_version(0);
+}
+
 void evtchn_do_upcall(struct pt_regs *regs)
 {
     unsigned long  l1, l2;
diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h
deleted file mode 100644 (file)
index eabe6d3..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef _I386_PTRACE_H
-#define _I386_PTRACE_H
-
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS  13
-#define EFL 14
-#define UESP 15
-#define SS   16
-#define FRAME_SIZE 17
-
-/* this struct defines the way the registers are stored on the 
-   stack during a system call. */
-
-struct pt_regs {
-       long ebx;
-       long ecx;
-       long edx;
-       long esi;
-       long edi;
-       long ebp;
-       long eax;
-       int  xds;
-       int  xes;
-       long orig_eax;
-       long eip;
-       int  xcs;
-       long eflags;
-       long esp;
-       int  xss;
-};
-
-/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-#define PTRACE_GETREGS            12
-#define PTRACE_SETREGS            13
-#define PTRACE_GETFPREGS          14
-#define PTRACE_SETFPREGS          15
-#define PTRACE_GETFPXREGS         18
-#define PTRACE_SETFPXREGS         19
-
-#define PTRACE_OLDSETOPTIONS         21
-
-#define PTRACE_GET_THREAD_AREA    25
-#define PTRACE_SET_THREAD_AREA    26
-
-#ifdef __KERNEL__
-#define user_mode(regs) ((regs) && ((VM_MASK & (regs)->eflags) || (2 & (regs)->xcs)))
-#define instruction_pointer(regs) ((regs)->eip)
-#endif
-
-#endif
index 05c6fc4abc69295dd3390113b9ea739be87fbbbf..920b1c31db8e2e3169702cbb6c778748f3358579 100644 (file)
@@ -458,7 +458,7 @@ do {                                                                          \
     _shared->vcpu_data[0].evtchn_upcall_mask = 0;                             \
     barrier(); /* unmask then check (avoid races) */                          \
     if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )              \
-        evtchn_do_upcall(NULL);                                               \
+        force_evtchn_callback();                                              \
 } while (0)
 
 #define __save_flags(x)                                                       \
@@ -473,7 +473,7 @@ do {                                                                          \
     if ( (_shared->vcpu_data[0].evtchn_upcall_mask = (x)) == 0 ) {            \
         barrier(); /* unmask then check (avoid races) */                      \
         if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )          \
-            evtchn_do_upcall(NULL);                                           \
+            force_evtchn_callback();                                          \
     }                                                                         \
 } while (0)
 
@@ -494,7 +494,7 @@ do {                                                                          \
     _shared->vcpu_data[0].evtchn_upcall_mask = 0;                             \
     barrier(); /* unmask then check (avoid races) */                          \
     if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )              \
-        evtchn_do_upcall(NULL);                                               \
+        force_evtchn_callback();                                              \
 } while (0)
 
 #define local_irq_save(x)      __save_and_cli(x)
index 7949b6e0887b5c1b231ad632716713489de4ca6d..d4c43ee91d0c8fdf229df72a4885c153828dd6b1 100644 (file)
@@ -20,6 +20,9 @@
  * LOW-LEVEL DEFINITIONS
  */
 
+/* Force a proper event-channel callback from Xen. */
+void force_evtchn_callback(void);
+
 /* Entry point for notifications into Linux subsystems. */
 void evtchn_do_upcall(struct pt_regs *regs);
 
@@ -47,7 +50,7 @@ static inline void unmask_evtchn(int port)
     {
         s->vcpu_data[0].evtchn_upcall_pending = 1;
         if ( !s->vcpu_data[0].evtchn_upcall_mask )
-            evtchn_do_upcall(NULL);
+            force_evtchn_callback();
     }
 }